<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
  <meta name="layout" content="blog">
  <title>My Posts</title>
  <g:javascript library="prototype"/>
</head>
<body>

<g:if test="${webRequest.actionName == 'listByTag'}">
<h2>Posts about ${tag.name}</h2>
</g:if>

<gp:secureLink controller="post" action="edit">
  Create a new post
</gp:secureLink>

<g:each in="${posts}" var="post">
  <div>
    <h3>
      <g:link controller="post" action="view" id="${post.id}">
        ${post.title}
      </g:link>
    </h3>
    <p class="teaser">${post.teaser}</p>
    <p class="lastUpdated">Last Updated: <g:formatDate format="dd-MMM-yyyy">${post.lastUpdated}</g:formatDate></p>
    <div class="tags" id="tags${post.id}">
      <g:render template="showTags" model="[post:post]"/>
    </div>
  </div>
</g:each>

</body>
</html>